Skip to content

Conversation

@ericmehl
Copy link
Collaborator

@ericmehl ericmehl commented Dec 9, 2025

This adds a new lightweight buffer object to IECorePython which supports Python's buffer protocol.

The buffer can be obtained from numeric-based *VectorData types with read-only or read-write access. Read-only buffers are advantageous because they will not need to make copies of the underlying data that read-write buffer may need to do for TypedData copy-on-write functionality.

Types that act as a consumer for Python's buffer protocol include Python's native memoryview object and Numpy's ndarray object.

Checklist

  • I have read the contribution guidelines.
  • I have updated the documentation, if applicable.
  • I have tested my change(s) in the test suite, and added new test cases where necessary.
  • My code follows the Cortex project's prevailing coding style and conventions.

@ericmehl
Copy link
Collaborator Author

ericmehl commented Dec 9, 2025

I don't have a solution for the test failures in the Linux debug build, but I do have some information about it. If I comment out

#include "IECore/HalfTypeTraits.h"
Cortex will actually build and the tests that are failing on CI pass.

A bunch of others will break from removing that include, but it's something to go on. I also tried commenting out individual specializations in HalfTypeTraits.h, and at least among those that didn't lead to build failures, none helped with the tests.

I'm guessing it's some kind of optimization issue between debug and release builds, but beyond that hunch I'll have to keep poking at it and see what happens.

@ericmehl
Copy link
Collaborator Author

ericmehl commented Dec 9, 2025

Oh, one more piece of information. If I go back to only the first commit, 20550fb, the tests pass. If I simply add #include "TypeTraits.h" to VectorTypedDataBinding.cpp`, they fail.

Then if I remove one of the two pairs of specializations at

template<>
struct is_unsigned<half> : public false_type{};
template<>
struct is_unsigned<const half> : public false_type{};
template<>
struct is_unsigned<volatile half> : public false_type{};
template<>
struct is_unsigned<const volatile half> : public false_type{};

it passes again.

But if I try that trick with the full set of commits, where TypeTraits is actually used and not just included, the failures are still present.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant